<?php

	session_start();
	require("connect.php");
	$link = connect_APO();
		
	require("check.php");
	is_logged_in();
	is_either();
	
	
	$midweekName=$_GET['midweek_name'];
	
	$sql = sprintf("SELECT * FROM `$midweekName`, users WHERE `$midweekName`.ID = users.ID");
	$result = mysql_query($sql);

	while($row = mysql_fetch_array($result)){
		$numberPeople += 1;
		$personID[] = $row["ID"];
		$personFName[] = $row["Fname"];
		$personLName[] = $row["Lname"];
		$personPhone[] = $row["PhoneNumber"];
		$personDrive[] = $row["Drive"];
	}
	
	

/*
	if(!is_leader_of_midweek()){
		header('Location: error.php?error=9');
	} 
	
	
*/

	require("header+logoutB.php");
	headerL();
	
	
	require("footer.php");
	footer();
	mysql_close($link);
?>